package j39;

import java.util.concurrent.ArrayBlockingQueue;

/**
 * @author chengshuai
 * @date 2021/4/15 11:17
 *
 * 测试线程阻塞
 */
public class BlockingQueueDemo3 {


    public static void main(String[] args) throws InterruptedException {

        ArrayBlockingQueue<Object> blockingQueue = new ArrayBlockingQueue<>(3);
        blockingQueue.put("a");
        blockingQueue.put("a");
        blockingQueue.put("a");
        System.out.println("=============");

        blockingQueue.take();
        blockingQueue.take();
        blockingQueue.take();
        blockingQueue.take();
    }

}
